/**
 * $Revision: 1.0 $
 * $Author: Geln Yang $
 * $Date: May 23, 2010 3:21:06 PM $
 *
 * Author: Geln Yang
 * Date  : May 23, 2010 3:21:06 PM
 *
 */
package com.gooex.web.action.gbuy.order;

import org.c4j.system.web.action.Ajaxable;
import org.c4j.system.web.action.Protected;

import com.gooex.domain.base.Order;
import com.gooex.domain.base.OrderCustomer;
import com.gooex.domain.base.emun.DeliverType;
import com.gooex.domain.base.emun.PayType;


/**
 * @author Geln Yang
 * @version 1.0
 */
public class OrderCustomerAjaxAction extends BaseOrderAction implements Protected, Ajaxable {

	private Order order;

	private OrderCustomer orderCustomer;

	private String orderId;

	private String customerId;

	private String payType;

	private String deliverType;

	public String updateChargeType() throws Exception {
		OrderCustomer customer = orderManager.getOrderCustomer(orderId, getCurrentUser().getId());
		if (customer != null) {
			customer.setPayType(PayType.get(Integer.valueOf(payType)));
			customer.setDeliverType(DeliverType.get(Integer.valueOf(deliverType)));
			orderManager.saveOrUpdate(customer);
		}
		return SUCCESS;
	}

	public OrderCustomer getOrderCustomer() {
		return orderCustomer;
	}

	public void setOrderCustomer(OrderCustomer orderCustomer) {
		this.orderCustomer = orderCustomer;
	}

	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}

	public void setDeliverType(String deliverType) {
		this.deliverType = deliverType;
	}

}
